﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ET.DataAccess;
using ET.Utility;
using ET.Entity;

public partial class Web_Login : System.Web.UI.Page
{
    DaEmployeeInfo daEmployeeInfo = new DaEmployeeInfo();
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {
        try
        {
            EtEmployeeInfo employeeInfo = daEmployeeInfo.CheckUser(txtUsername.Text.Trim(), txtPassowrd.Text.Trim());
            if (employeeInfo != null)
            {
                SessionManager.User = employeeInfo;
                Response.Redirect("Registry.aspx");
            }
            else
            {
                lblInfo.Text = "Invalidate username or password!";
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }
}